﻿//
// (C) Copyright 2009 Irantha Suwandarathna (irantha@gmail.com)
// All rights reserved.
//

using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using EffiProzDB;
using EffiProzDB.Lib;


namespace EffiProzDBTest
{
    public abstract class BaseTest
    {
        protected SessionInterface sessionProxy;
        protected String user = "sa";
        protected String password = "";
        protected String connType = DatabaseURL.S_MEM;
        protected String host = "localhost";
        protected int port = 0;
        protected String path = "Test";
        protected String database = "Test";
        protected string sql = "";
        protected HsqlProperties props = new HsqlProperties();
        protected string dataPath = "../../../EffiProzDBTest/Data/";


        protected void CleanUp(string prefix)
        {
            string[] files = Directory.GetFiles(dataPath, prefix + "*");
            foreach (var file in files)
                File.Delete(file);
        }


        public BaseTest()
        {
            sessionProxy = DatabaseManager.newSession(connType, database,
                      user, password, props);           
        }

    }
}
